#include <iostream>
#include <string>

int main(void)
{
	using namespace std;
	unsigned int vowel = 0;
	unsigned int consonant = 0;
	unsigned int other = 0;
	string str;

	cout << "Enter words (q to quit):\n";
	while ((cin >> str))
	{
		if (str.length() == 1 && str[0] == 'q')
			break;
		if (isalpha(str[0]))
		{
			if (str[0] == 'a' || str[0] == 'e' || str[0] == 'i'||
					str[0] == 'o' || str[0] == 'u')
				vowel++;
			else
				consonant++;
		}
		else
			other++;
	}

	cout << vowel << " words beginning with vowels\n";
	cout << consonant << " words beginning with consonants\n";
	cout << other << " others" << endl;
	return 0;
}
